<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/member/layout/contentLayout.xhtml">

	<!-- 页面标题 -->
	<ui:param name="param_pageTitle" value="路远商城->我的信息" />
	<ui:param name="editInfo" value="true" />

	<ui:define name="navigation">
		<a href="http://www.luyuansc.com/">路远商城</a> 
		&gt; 
		我的信息
	</ui:define>

	<ui:define name="content">
		<div class="main clear">
			<div class="sidebar">
				<ui:include src="layout/nav.xhtml" />
			</div>
			<div class="middle">
				<h:messages errorClass="msg ERROR" errorStyle="display:none" infoClass="msg INFO" warnClass="msg WARN"></h:messages>
			<h:form id="userForm">
				<rg:titlePanel type="wirtable" needButton="true" headerTitle="编辑我的信息">
					<rg:fieldSet>
						<rg:outputText id="memNumber" label="#{messages.luyuan_member_memNumber}" value="#{memberAction.memberModel.account.username}"/>
						<rg:inputText id="name" required="true" label="#{messages.luyuan_member_name}" value="#{memberAction.memberModel.name}"  />
						<rg:selectOne id="gender"  required="true"  label="姓别" value="#{memberAction.memberModel.gender}" 
		                    converter="#{genderConverter}" itemsProvider="#{genderProvider}"/>
	                    <rg:field label="生日">
	                    	<rg:datetime value="#{memberAction.memberModel.birthDate}" datePattern="yyyy-MM-dd" />
	                    </rg:field>
						<rg:inputText id="mobile"  required="true"  label="#{messages.luyuan_member_mobile}" 
							value="#{memberAction.memberModel.mobile}"  validator="#{customerMoblieValidator}"/>
						<rg:inputText id="qq" label="QQ" value="#{memberAction.memberModel.qq}" />
						<rg:inputText id="email" label="#{messages.luyuan_member_email}" value="#{memberAction.memberModel.email}" />
						<rg:inputText id="nativePlace" label="籍贯" value="#{memberAction.memberModel.nativePlace}"/>
	                    <rg:field id="address" label="#{messages.luyuan_member_addresses}">
	                    	<h:selectOneMenu id="province" value="#{memberAction.memberModel.address.province}" styleClass="select" 
	                    		onchange="jQuery('#userForm\\:city').val(null);jQuery('#userForm\\:region').val(null);">
	                    		<f:selectItem itemLabel="请选择省"/>
	                    		<f:selectItems value="#{provinceProvider.getSelectItems(null)}" eventsQueue="address"/>
	                    	</h:selectOneMenu>
	                    	<h:selectOneMenu id="city" value="#{memberAction.memberModel.address.city}"   styleClass="select" 
	                    		onchange="jQuery('#userForm\\:region').val(null);">
	                    		<f:selectItem itemLabel="请选择市"/>
	                    		<f:selectItems value="#{cityProvider.getSelectItems(memberAction.memberModel.address.province)}" />
	                    		<rg:reference for="province" eventsQueue="address"/>
	                    	</h:selectOneMenu>
	                    	<h:selectOneMenu id="region" value="#{memberAction.memberModel.address.region}" styleClass="select"  >
	                    		<f:selectItem itemLabel="请选择区（县）"/>
	                    		<f:selectItems value="#{regionProvider.getSelectItems(memberAction.memberModel.address.province,memberAction.memberModel.address.city)}" />
	                    		<rg:reference for="province,city" eventsQueue="address"/>
	                    	</h:selectOneMenu>
	                    </rg:field>
                   		<rg:inputText id="street" value="#{memberAction.memberModel.address.street}" textStyle="width:280px;"/>
						<rg:inputText id="postCode" label="#{messages.luyuan_member_postCode}" value="#{memberAction.memberModel.address.postCode}" >
							<rg:reference for="city,region" actionListener="#{memberAction.resetPostCode}" eventsQueue="address"/>
						</rg:inputText>
					</rg:fieldSet>
					<ui:define name="panelButton">
						<h:commandButton styleClass="button"
							value="提交修改" onclick="UI.instance.showMask()"
							action="#{memberAction.updateUser()}" />
					</ui:define>
				</rg:titlePanel>
			</h:form>
			</div>
		</div>	
	</ui:define>

</ui:composition>